<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Session 变量</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="reserved.variables.request.html">$_REQUEST</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="reserved.variables.environment.html">$_ENV</a></div>
 <div class="up"><a href="reserved.variables.html">预定义变量</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="reserved.variables.session" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">$_SESSION</h1>
  <h1 class="refname">$HTTP_SESSION_VARS [已弃用]</h1>
  <p class="refpurpose"><span class="refname">$_SESSION</span> -- <span class="refname">$HTTP_SESSION_VARS [已弃用]</span> &mdash; <span class="dc-title">Session 变量</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-reserved.variables.session-description">
  <h3 class="title">说明</h3>
  <p class="para">
   当前脚本可用 SESSION 变量的数组。更多关于如何使用的信息，参见 <a href="ref.session.html" class="link">Session 函数</a> 文档。
  </p>

  <p class="simpara">
   <var class="varname"><var class="varname">$HTTP_SESSION_VARS</var></var> 包含相同的信息，但它不是一个<a href="language.variables.superglobals.html" class="link">超全局变量</a>。
   (注意 <var class="varname"><var class="varname">$HTTP_SESSION_VARS</var></var> 和 <var class="varname"><var class="varname">$_SESSION</var></var> 是不同的变量，PHP 处理它们的方式不同)
  </p>
 </div>

 
 <div class="refsect1 changelog" id="refsect1-reserved.variables.session-changelog">
  <h3 class="title">更新日志</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>版本</th>
       <th>说明</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>4.1.0</td>
       <td>
        引入 <var class="varname"><var class="varname">$_SESSION</var></var>，弃用 <var class="varname"><var class="varname">$HTTP_SESSION_VARS</var></var>。
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>

 
 <div class="refsect1 notes" id="refsect1-reserved.variables.session-notes">
  <h3 class="title">注释</h3>
  <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para">“Superglobal”也称为自动化的全局变量。这就表示其在脚本的所有作用域中都是可用的。不需要在函数或方法中用
<strong class="command">global $variable;</strong> 来访问它。</p></p></blockquote>
 </div>

 
 <div class="refsect1 seealso" id="refsect1-reserved.variables.session-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.session-start.html" class="function" rel="rdfs-seeAlso">session_start()</a> - Start new or resume existing session</span></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="reserved.variables.request.html">$_REQUEST</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="reserved.variables.environment.html">$_ENV</a></div>
 <div class="up"><a href="reserved.variables.html">预定义变量</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
